<nav ngbNav
     #nav="ngbNav"
     class="nav-tabs">
  <ng-container ngbNavItem>
    <a ngbNavLink
       i18n>Pools List</a>
    <ng-template ngbNavContent>
      <cd-table #table
                id="pool-list"
                [data]="pools"
                [columns]="columns"
                selectionType="single"
                [hasDetails]="true"
                [status]="tableStatus"
                [autoReload]="-1"
                (fetchData)="taskListService.fetch()"
                (setExpandedRow)="setExpandedRow($event)"
                (updateSelection)="updateSelection($event)">
        <cd-table-actions id="pool-list-actions"
                          class="table-actions"
                          [permission]="permissions.pool"
                          [selection]="selection"
                          [tableActions]="tableActions">
        </cd-table-actions>
        <cd-pool-details *cdTableDetail
                         id="pool-list-details"
                         [selection]="expandedRow"
                         [permissions]="permissions"
                         [cacheTiers]="cacheTiers">
        </cd-pool-details>
      </cd-table>
    </ng-template>
  </ng-container>

  <ng-container ngbNavItem
                *cdScope="'grafana'">
    <a ngbNavLink
       i18n>Overall Performance</a>
    <ng-template ngbNavContent>
      <cd-grafana i18n-title
                  title="Ceph pools overview"
                  [grafanaPath]="'ceph-pools-overview?'"
                  [type]="'metrics'"
                  uid="z99hzWtmk"
                  grafanaStyle="two">
      </cd-grafana>
    </ng-template>
  </ng-container>
</nav>

<div [ngbNavOutlet]="nav"></div>

<ng-template #poolUsageTpl
             let-row="data.row">
  <cd-usage-bar *ngIf="row.stats?.avail_raw?.latest"
                [total]="row.stats.bytes_used.latest + row.stats.avail_raw.latest"
                [used]="row.stats.bytes_used.latest"
                [title]="row.pool_name"
                decimals="2">
  </cd-usage-bar>
</ng-template>
